<%@ page language="java" pageEncoding="utf8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>"
			type="text/css" />
	</head>
	<body style="">
		<div id="headBar" class="head_content"></div>
		<div id="main" class="main_content">
			<form enctype="multipart/form-data" method="post"
				action="page_friendLink_save.html"
				id="friendLink_form">
				<input type="hidden" value="${systemFriendLink.linkId}" name="systemFriendLink.linkId">
					 
					<div class="division">
						<table width="100%" cellspacing="0" cellpadding="0" border="0">
							<tbody>
								<tr>
									<th>
										友情链接名称：
									</th>
									<td>
										<input type="text" value="${systemFriendLink.linkName}"
											name="systemFriendLink.linkName" class="x-input "  > 
									</td>
								</tr>
								<tr>
									<th>
										链接地址：
									</th>
									<td>
										<input type="text" value="${systemFriendLink.linkHref}" name="systemFriendLink.linkHref"
											class="x-input "  >
											 
									</td>
								</tr>
								<tr>
									<th>
										友情链接图片：
									</th>
									<td>
										<input type="file" name="upload" class="x-input " />
									</td>
								</tr>
								<tr>
									<th>
										排序
									</th>
									<td>
										<input type="text" value="${systemFriendLink.showOrder }"  
											style="width: 50px;" name="systemFriendLink.showOrder" class="x-input " > 
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="table-action">
						<button class="btn" type="submit">
							<span><span>保存</span>
							</span>
						</button>
					</div>
			</form>
		</div>
		<div id="footBar" class="foot_content"></div>



 		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/jquery.validate.js'/>"></script>
		<script type="text/javascript">

	$(document).ready(function() {
		var validator = $("#friendLink_form").validate( {
			errorElement : "div",
			errorClass : "x-vali-error",
			onfocusout : false,
			rules : {
				'systemFriendLink.linkName' : "required",
				
				'systemFriendLink.linkHref' : {
					required : true,
					url : true
				},
				'systemFriendLink.showOrder' : {
					required : true,
					number : true
				}
			},
			messages : {
				'systemFriendLink.linkName' : "必填字段",
				
				'systemFriendLink.linkHref' : {
					required : "必填字段",
					url : "请填入链接格式 http://aaa.bbb.com"
				},
				'systemFriendLink.showOrder' : {
					required : "必填字段" 
				}
			},
			errorPlacement : function(error, element) {
				element.removeClass('x-vali-error');
				error.appendTo(element.parent());

			},

			success : function(div) {
				$(div).remove();
			}
		});
	});
</script>
	</body>
</html>